/**
 * @name         RepNET Bill Entry Controller
 * @version      1.0a
 * @author 		 Thusira Dissanayake <thusira14@gmail.com>
 * @about        Developed by MiDi
 * @license	 http://www.gnu.org/licenses/lgpl-2.1.html GNU Lesser General Public License (LGPL)
 * @lastModified 2012.09.24
 */
package com.midi.wholesale.main;

/**
 * Class to handle Bill Entry data entry
 * @author Prabodha
 * 
 */
import java.sql.*;




public class StockDetail {

	static String sql;

	public boolean submitData(int item_id,int amount) {
		boolean val;
		int itemID=item_id;
        

		try {
			Statement statement = Main.dbConnection.createStatement();

			sql = "UPDATE item SET `current_status`=1,`available_amount`='"+amount+"' WHERE id='"+item_id+"'";
			
			// The same value of the amount insert to remainder
			statement.executeUpdate(sql);
			System.out.println("Record is updated in item table!");
			val = true;

		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			val = false;
		}
		return val;
	}
}
